﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class register : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        txtuser.Focus();
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        if(func.ishave(txtuser.Text.Trim())==false)
        {
              if(func.res(txtuser.Text.Trim(), txtqr.Text.Trim(), txtph.Text.Trim(), txtemail.Text.Trim()))
            {
                Response.Write("<script>alert('注册成功');location.href='login.aspx';</script>");

            }

        }
        else
        {
            Response.Write("<script>alert('此用户已经存在')</script>");

        }
    }
}